package org.zgy.stock.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.zgy.stock.dto.StockPriceDto;
import org.zgy.stock.mapper.StockPriceMapper;
import org.zgy.stock.model.StockPrice;

import java.util.Collection;
import java.util.List;

@Service
public class StockPriceService {
    @Autowired
    private StockPriceMapper stockPriceMapper;

    public void batch_insert(Collection<StockPrice> stockPriceDtoList) {
//        List<StockPrice> list = stockPriceDtoList.stream().map(StockPriceDto::convert).toList();
        System.out.println(stockPriceDtoList.size());
        stockPriceMapper.insert(stockPriceDtoList);
    }

    public List<String> getHandledCodeList() {
        return  stockPriceMapper.getStockCodeList();
    }

}
